home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 117 / MacAddict 117.dmg / Software / Internet & Communication / Snak 5.1 (shareware).dmg / Snak.app / Contents / Resources / Scripts / CTCPCatcher.txt < prev    next >
Text File  |  2005-03-14  |  2KB  |  55 lines

  1. # lines with '#' are comments that are not executed
  2.  
  3. # This file contains examples of how to add additional functionality to Snak. 
  4. # The examples respond to new CTCP requests or changes the way existing 
  5. # requests are handled.
  6.  
  7. # To automatically load this into a connection, add "/load ctcpcatcher" to the startup actions.
  8.  
  9. # This method can add additional processing of existing CTCP functions
  10. # Snaks existing CTCP processing will still happen
  11.  
  12. on ^ctcp "% % CLIENTINFO *" {
  13.     echo *** $0 requests your CLIENTINFO
  14. }
  15.  
  16.  
  17. # this method can als add new CTCP selectors like PAGE. Your processing of Beeps 
  18. # must be set on in the preferences, or the command will be silent
  19.  
  20. # Depending on your editor you may or may not be able to see that there are two "beep"
  21. # characters before and after the text.
  22.  
  23. # the '^' in front of ctcp makes Snak stop processing of the message after the handler 
  24. # has executed. If this was '-' or missing then Snak would try and do PAGE as well 
  25. # but this would give an error message
  26.  
  27. on ^ctcp "% % PAGE" {
  28.     echo *** --------------------------------------
  29.     echo *** * CTCP PAGE received from $[10]0 *
  30.     echo *** --------------------------------------
  31. }
  32.  
  33.  
  34. # the raw_irc method a way to be the very first that accesses incoming data
  35. # it is only way that can block the existing processing of CTCP requests by swallowing 
  36. # the data before any other parts of Snak acts on it
  37.  
  38. # This script uses the $nickonly function from the Basical script file.
  39. # The function splits the nick!userhost string and returns the nick.
  40.  
  41. # Input:
  42. # $0 : nick!userhost
  43.  
  44. ^on ^raw_irc "% PRIVMSG % :**VERSION**" {
  45.     echo *** $0 requested your client version
  46.     quote NOTICE $nickonly($0) :VERSION A really good IRC client
  47. }
  48.  
  49. # emits three beeps. Can be added to a script snippet so you can hear that it executed
  50. # Depending on your editor you may or may not be able to see that there are three "beep"
  51. # characters before the text.
  52. alias beeper {
  53.     echo  something happened
  54. }
  55.